package com.zhoukx.netty.inboundhandlerAndOutboundhandler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;


public class MyServerIniitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        // 入栈的handler进行解码 , MyByteTolongDecoder
        //pipeline.addLast(new MyByteTolongDecoder());
        pipeline.addLast(new MyByteToLongDecodec2());
        pipeline.addLast(new MyLongToByteEncodec());
        pipeline.addLast(new MyServerHandler());
    }
}